﻿#parse("partials/header.html") #parse("partials/sidebar.html")
<style>
    div#datalist_filter
    {
        display: none;
    }
    div#datalist_length
    {
        display: none;
    }
    .mws-table thead
    {
        margin-top: -10px;
    }
</style>
<script type="text/javascript">
    $(document).ready(function () {

        var oTable = $('#datalist').dataTable({
            "bSort": false,
            "sPaginationType": "full_numbers",
            "bProcessing": false,
            "bServerSide": true,
            "bFilter": true,
            "sAjaxSource": "tablelistpurchasereqmaster",
            "aoColumns": [
                                { "mDataProp": "purchaseid" },
                                { "mDataProp": "CodeValue" },
                                { "mDataProp": "ReleasedDate" },
                                { "mDataProp": "name" },
                                { "mDataProp": "DocumentStatus" }
                            ],
            "aoColumnDefs": [
                                {
                                    "fnRender": function (o) {
                                        return "<center><a title='Workflow' class='bank' href='/workflow/default/viewapproval/?id=" + o.aData['purchaseid'] + "' id='" + o.aData['purchaseid'] + "' ><img src='/images/Icons/process_icon_2.gif'/></a> <a title='View' class='bank' href='/purchasing/purchaserequisition/editpurchaserequisition/?id=" + o.aData['purchaseid'] + "'><img src='/images/Icons/table.png'/></a></center>";
                                    },
                                    "aTargets": [0]
                                }
                        ],
            "fnServerData": function (sSource, aoData, fnCallback) {
                aoData.push({ "name": "startdate", "value": $('#startdate').val() });
                aoData.push({ "name": "enddate", "value": $('#enddate').val() });
                aoData.push({ "name": "prnumber", "value": $('#prnumber').val() });

                jQuery.ajax({
                    "dataType": 'json',
                    "type": "GET",
                    "url": "tablelistpurchasereqmaster",
                    "data": aoData,
                    "success": fnCallback
                });
            }
        })

        $('#buttonSearch').click(function () {
            oTable.fnDraw();
        });

    });
    //Add event click on list doctor
    $(".bank").live('click', function (event) {
        var bankid = $(this).attr("id");
        window.location = "/purchasing/purchaserequisition/editpurchaserequisition/";
    });

</script>
<!-- Main Container Start -->
<div id="mws-container" class="clearfix">
    <!-- Inner Container Start -->
    <div class="container">
        <!-- Panels Start -->
        <div class="mws-panel grid_8 mws-collapsible">
            <div class="title-caption">
                <h5>$headerinformation  - Purchase Requisition</h5>
            </div>
            <div class="mws-panel-header">
                <span class="mws-i-24 i-documents">Purchase Request</span>
            </div>
            <div class="mws-panel-body">
                <div class="mws-panel-toolbar top clearfix">
                    <ul>
                        <li><a class="mws-ic-16 ic-add" href="/purchasing/purchaserequisition/createpurchaserequisition/"
                            title="Accept">Add Purchase Request</a></li>
                        
                        <li><a class="mws-ic-16 ic-add" href="/workflow/mastertemplete/"
                            title="Accept">Workflow Master Templete</a></li>
                    </ul>
                </div>
                <div class="mws-form" action="#">
                    <div class="mws-form-inline">
                        <div class="mws-form-row">
                            <label>
                                From Date</label>
                            <div class="mws-form-item large">
                                <div class="mws-form-cols clearfix">
                                    <div class="mws-form-col-2-8 alpha">
                                        <div class="mws-form-item">
                                            <input id="startdate" name="startdate" type="text" class="mws-textinput mws-datepicker"
                                                readonly="readonly" />
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="mws-form-row">
                            <label>
                                To Date</label>
                            <div class="mws-form-item large">
                                <div class="mws-form-cols clearfix">
                                    <div class="mws-form-col-2-8 alpha">
                                        <div class="mws-form-item">
                                            <input id="enddate" name="enddate" type="text" class="mws-textinput mws-datepicker"
                                                readonly="readonly" />
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="mws-form-row">
                            <label>
                                PR Number</label>
                            <div class="mws-form-item large">
                                <div class="mws-form-cols clearfix">
                                    <div class="mws-form-col-2-8 alpha">
                                        <div class="mws-form-item">
                                            <input id="prnumber" name="prnumber" type="text" class="mws-textinput" />
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <br />
                        <div class="mws-button-row">
                            <input id="buttonSearch" type="submit" value="Search" class="mws-button red" />
                        </div>
                    </div>
                    <br />
                    <table cellpadding="0" cellspacing="0" border="0" class="fullwidth mws-table" id="datalist"
                        width="80%">
                        <thead>
                            <tr>
                                <th style="text-align: center; width: 10px">
                                    Actions
                                </th>
                                <th style="text-align: center">
                                    PR Number
                                </th>
                                <th style="text-align: center;width: 100px">
                                    Request Date
                                </th>
                                <th style="text-align: center">
                                    Request By
                                </th>
                                <th style="text-align: center;width: 150px">
                                    Document Status
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td colspan="7" class="dataTables_empty">
                                    <!--<img src="${rooturl}Images/Custom/252.gif" />-->
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                <div class="clear">
                </div>
            </div>
        </div>
    </div>
    <!-- Panels End -->
</div>
<!-- Main Container End -->
#parse("partials/footer.html") 